<?php include('php/authenticatephastregex.php'); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
 "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
  <head>
    <title>Phastregex. in-silico chip-seq</title>
    <meta http-equiv="Content-Type" content ="text/html; charset=utf-8">
    <link rel="stylesheet" href="phastregexstylejw.css" type="text/css">
    <?php include('php/jasonweirather.php'); ?>
  </head>
  <body>
    <?php include('php/logoline.php'); ?>
    <div id = "genename_block">
    <?php
      $filename = $_POST["local_file_name"];  # optionally bring in the local file name
      $ctcf = $_POST["ctcf"];
      $species = $_POST["species"];  # optionally bring in the species
      $title = $_POST["title"];  # optionally bring in the title    
      ### check to see if it is in the database and completed already.
      $database = 'zebraphish';
      include("php/dbconnect.php");
      #get the info we need.
      echo('<form enctype="multipart/form-data" action="do_genename.php" method="post">
        ');
         if($filename != NULL) { 
            echo("<input type=\"hidden\" name=\"local_file_name\" value=\"$filename\"/> filename is $filename<br>\n");
         } else {
            echo('Filename generated by server: <input type="text" name="local_file_name"/><br>');
         }
         echo('
               Choose Species:<select id="table_menu" name="species">
                 <option value="hg18" selected="yes">Human (hg18)</option>
                 <option value="mm9">Mouse (mm9)</option>
                 <option value="danrer4">Zebrafish (danrer4)</option>
                 <option value="fr2">Fugu (fr2)</option>
               </select><br>
              Use absolute limits or ctcf bounds (hg18 only)?<select name="ctcf">
                 <option value="false" selected="yes">absolute limits (bp distance)</option>
                 <option value="true">ctcf bounds</option>
               </select><br>
              cell_type (ctcf only): <select name="cell_type">');
      $query = "SELECT DISTINCT(cell_type) as ct FROM ctcf_bounds ORDER BY cell_type";
      $result = mysql_query($query);
      $i = 0;
      while($row = mysql_fetch_object($result)) {
        echo '<option value="'.$row->ct.'" ';
        if($i == 0) { echo'selcted = "yes"'; }
        echo '>'.$row->ct.'</option>' . "\n";
        $i++;
      }   
      echo('</select><br>' . "\n");
echo('
      Set distance, basepairs upstream and downstream of genes to return results (if not using ctcf): <input type="text" value="500000" name="max_distance"/><br>
          <input type="submit" value="Submit"/>
      </form>
      ');

    ?>
    </div>
    <?php include('php/lastline.php'); ?>
  </body>
</html> 
